<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <script>
      //
      let str = 'hello,beijin'
      console.log(str.startsWith("he"))
      console.log(str.endsWith("jin"))
      console.log(str.includes("he"))

      //使用``来总括分行的字符串
      str = `<div>
            <span>kkk</span>
            </div>`
      console.log(str)

      let [name, age] = ['tom', 20]

      //在字符串中插入变量和表达式，变量名写在${}中，${}也可放入js表达式
      let info = `I'm ${name}, i'm ${age + 10}`
      console.log(info)

      //插入函数
      function fun(){
        return '是的，不错！'
      }
      let say = `今天天气不错！${fun()}`
      console.log(say)
    </script>
  </body>
</html>
